package com.zxl.live.screen.screen.constant;

import com.zxl.live.tools.common.ApplicationHelper;
import com.zxl.live.tools.configs.AdsConfigsHelper;
import com.zxl.live.tools.tools.StorageAddressUtil;

import java.util.List;

/**
 * Created by Administrator on 2016/7/5.
 */
public interface LockerEnv {

    /**
     * 自定义包名
     */
    interface Package {

        String PACKAGE_NAME = ApplicationHelper.getContext().getPackageName();

        String PM_PACKAGE_NAME = "com.zxl.manager.privacy";

        String MARKET = "com.android.vending";
    }

    interface Process {

        String MAIN_PROCESS = Package.PACKAGE_NAME;

        String CORE_PROCESS = "com.android.core";

        String SCREEN_PROCESS = "com.android.screen";
    }

    interface Path {

        String ROOT_PATH = StorageAddressUtil.getStorage(ISharedPreferences.SP_DEFAULT_MULTI_PROCESS, "sdcard_path");

        String SCREEN_PATH = ROOT_PATH + "/screen/";

        String WALLPAPER_DATA = SCREEN_PATH + ".data/wallpaper/";

        String LOCAL_WALLPAPER_PATH = SCREEN_PATH + "download/wallpaper/";

        String RINGTONE_DATA = SCREEN_PATH + ".data/ringtone/";

        String LOCAL_RINGTONE_PATH = SCREEN_PATH + "download/ringtone/";

        String ICON_PATH = SCREEN_PATH + ".data/icon/";

        String STORE_PATH = SCREEN_PATH + ".data/lock/";

        String THEME_DIR = ROOT_PATH + "/PrivacyManager/theme/";

        String CALL = SCREEN_PATH + ".data/call/";

        String LOCAL_CALL = SCREEN_PATH + "download/call/";

        String LOCK = SCREEN_PATH + ".data/lock/";

        String LOCAL_LOCK = SCREEN_PATH + "download/lock/";

        String SUI_SCREEN = SCREEN_PATH + "download/sui/";

        String GIF_DATA = SCREEN_PATH + ".data/gif/";

        String GIF_PATH = SCREEN_PATH + "download/live/";

        String SNS_DATA = SCREEN_PATH + ".data/sns/";

        String SNS_PATH = SCREEN_PATH + "download/sns/";
    }

    /**
     * Market搜索用到的常量
     *
     */
    interface Market {

        // 用包名搜索market上的软件
        public static final String BY_PKGNAME = "market://search?q=pname:";

        // 直接使用关键字搜索market上的软件
        public static final String BY_KEYWORD = "market://search?q=";

        // 进入软件详细页面
        public static final String APP_DETAIL = "market://details?id=";

        String QQ_PRIVACY_URL = "http://sj.qq.com/myapp/detail.htm?apkName=com.zxl.manager.privacy";
    }

    public class Position {

        private static final String SHUFFLE_ADS_XM = "9721ac45f80825ea417a326f38941e20";

        private static final String SCREEN_SETTINGS_BANNER_ADS_XM = "941853c62f19e3f153721c4618bcc4d4";

        private static final String MAIN_RECOMMEND_ADS_XM = "9a260b4bfc0d786f53ff32fc3e190968";

        private static final String LOCK_CLEAN_ADS_XM = "9aba3d1a1c5d168b2d4f4dd763e16a67";

        private static final String LOCK_NOTIFY_ADS_XM = "e03510e392401b1c58d41e40704aa614";


        public static String getShuffleAdsXm() {
            return SHUFFLE_ADS_XM;
        }

        public static String getMainRecommendAdsXm() {
            return MAIN_RECOMMEND_ADS_XM;
        }

        public static String getScreenSettingsBannerAdsXm() {
            return SCREEN_SETTINGS_BANNER_ADS_XM;
        }

        public static String getLockNotifyAdsXm() {
            return LOCK_NOTIFY_ADS_XM;
        }

        public static String getLockCleanAdsXm() {
            return LOCK_CLEAN_ADS_XM;
        }

        public static String getFullScreenAds() {
            List<String> list = AdsConfigsHelper.getFullScreenBean().getAdsPositionList();
            if (!list.isEmpty()) {
                return list.get((int) (Math.random() * list.size()));
            }
            return LOCK_NOTIFY_ADS_XM;
        }

        public static String getKeyboardAds() {
            List<String> list = AdsConfigsHelper.getKeyboardBean().getAdsPositionList();
            if (!list.isEmpty()) {
                return list.get((int) (Math.random() * list.size()));
            }
            return LOCK_CLEAN_ADS_XM;
        }
    }

}
